<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<body>
<a4j:form>
	<h:panelGrid columns="3">
    Mesaj:<h:inputText value="#{chatData.currentMessage.content}" />
    <h:commandButton action="#{chatData.addMessage}" value="Gonder" />
    </h:panelGrid>
    <br/><br/><br/>
    <a4j:poll interval="1000" reRender="list"/>
</a4j:form>
<h:form>
<rich:dataTable id="list" value="#{chatData.messages}" var="k">
	<rich:column>
		<f:facet name="header">
			<h:outputText value="Mesajlar" />
		</f:facet>
		<h:inputText value="#{k.content}" />
	</rich:column>
	<rich:column sortBy="#{k.date}">
		<f:facet name="header">
			<h:outputText value="Tarih" />
		</f:facet>
		<h:inputText value="#{k.date}" >
		<f:convertDateTime pattern="dd.MM.yyyy HH:mm:ss"/>
		</h:inputText>
	</rich:column>
</rich:dataTable>
</h:form>
</body>


</html>